home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / sigprc07 < prev    next >
Text File  |  1997-07-08  |  785b  |  22 lines

  1. ; This batch file creates a plot of the power spectrum of 
  2. ; the simulated signal used in the example from Chapter 13,
  3. ; "Signal Processing", of _Using IDL_, after a Hamming window
  4. ; has been applied.
  5.  
  6. @sigprc01.bat ; compute time data sequence u
  7.  
  8. F = FINDGEN(N/2+1) / (N*delt) ; f = [0.0, 1.0/(N*delt), ... , 1.0/(2.0*delt)]
  9.  
  10. v_m = FFT(HANNING(N, ALPHA=0.54)*U)
  11.  
  12. ; log-log plot of power spectrum
  13.  
  14. PLOT, F, ABS(v_m(0:N/2))^2, YTITLE='Power Spectrum', $
  15.     /YLOG, YRANGE=[1.0e-8,1.0], YSTYLE=1, YMARGIN=[4,4], $
  16.     XTITLE='Frequency in cycles / second', $
  17.     /XLOG, XRANGE=[1.0,1.0/(2.0*delt)], XSTYLE=1, $
  18.     TITLE='Power Spectrum of u(k) with Hamming Window ' $
  19.     +'!C(solid) and without Window (dashed)'
  20.  
  21. OPLOT, F, ABS((FFT(U))(0:N/2))^2, LINESTYLE=2 ; overplot without window
  22.